<?php
/*code here*/
if(Auth::hasAuth('current_user')){
    $this->view->current_user = Auth::getAuth('current_user');
    $db = new Database();
    $auth = Auth::getAuth('current_user');
    $userLevel = $auth['userlevel_id'];
    $getUser = $db->query("SELECT * FROM tbuser WHERE userlevel_id='$userLevel'");
    foreach($getUser as $data){
        $level = $data['userlevel_id'];
    }
    $getLevel = $db->query("SELECT * FROM tbuserlevel WHERE id='$level' and is_active='1'","array");
    foreach($getLevel as $dataLevel){
        $dbLevel = $dataLevel['userlevel'];
    }
    if($dbLevel=="User"){
        header('Location: /balance_inquiry');
    }
}
else{
    header('location: /');
}

/*code here(end)*/
$this->setLayout();

 